google.load("visualization", "1", {
	packages : [ "corechart" ]
});
google.setOnLoadCallback(drawChart1);
google.setOnLoadCallback(drawChart2);
google.setOnLoadCallback(drawChart3);
google.setOnLoadCallback(drawChart4);
// div1
function drawChart1() {
	var data = google.visualization.arrayToDataTable([
			[ 'Day', '불량률', '기계수명(hp)', '매출액', '달성률' ],
			[ '2004', 1000, 100, 300, 400 ], [ '2005', 1170, 80, 500, 460 ],
			[ '2006', 660, 40, 430, 1120 ], [ '2007', 1030, 10, 500, 540 ] ]);

	var options = {
		title : 'Company Performance',
		width : 600,
		height : 400,
		hAxis : {
			title : 'Year',
			titleTextStyle : {
				color : 'red'
			}
		}
	};

	var chart = new google.visualization.ColumnChart(document
			.getElementById('div1'));
	chart.draw(data, options);
}

// div chart2
function drawChart2() {
	var data = google.visualization
			.arrayToDataTable([ [ 'Day', 'resource', '완제품(개)' ],
					[ '2004', 1000, 400 ], [ '2005', 1170, 460 ],
					[ '2006', 660, 1120 ], [ '2007', 1030, 540 ] ]);

	var options = {
		title : 'Company Performance',
		width : 300,
		height : 400,
		hAxis : {
			title : 'Year',
			titleTextStyle : {
				color : 'red'
			}
		}
	};

	var chart = new google.visualization.ColumnChart(document
			.getElementById('div2'));
	chart.draw(data, options);
}
// div 3
function drawChart3() {
	var data = google.visualization.arrayToDataTable([
			[ 'Day', '일일요구량(개)', '완제품(개)', '달성률(%)' ],
			[ '2004', 1000, 400, 80 ], [ '2005', 1170, 460, 77 ],
			[ '2006', 1120, 800, 90 ], [ '2007', 1030, 540, 60 ] ]);

	var options = {
		title : 'Company Performance',
		width : 300,
		height : 400,
		hAxis : {
			title : 'Year',
			titleTextStyle : {
				color : 'red'
			}
		}
	};

	var chart = new google.visualization.ColumnChart(document
			.getElementById('div3'));
	chart.draw(data, options);
}

// div 4
function drawChart4() {
	var data = google.visualization.arrayToDataTable([
			[ 'Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea',
					'Rwanda', 'Average' ],
			[ '2004/05', 165, 938, 522, 998, 450, 614.6 ],
			[ '2005/06', 135, 1120, 599, 1268, 288, 682 ],
			[ '2006/07', 157, 1167, 587, 807, 397, 623 ],
			[ '2007/08', 139, 1110, 615, 968, 215, 609.4 ],
			[ '2008/09', 136, 691, 629, 1026, 366, 569.6 ] ]);

	var ac = new google.visualization.ComboChart(document
			.getElementById('div4'));
	ac.draw(data, {
		title : 'Monthly Coffee Production by Country',
		width : 600,
		height : 400,
		vAxis : {
			title : "Cups"
		},
		hAxis : {
			title : "Month"
		},
		seriesType : "bars",
		series : {
			5 : {
				type : "line"
			}
		}
	});
	var chart = new google.visualization.ColumnChart(document
			.getElementById('div4'));
	chart.draw(data);
}
var xhr; // ajax 송수신을 담당하는 객체
function createXMLHttpRequest(){
	if(window.ActiveXObject){
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		xhr = new XMLHttpRequest();
	}
}
function callback(){
	createXMLHttpRequest();
			alert(xhr.responseText);
}